package com.redoor.iot.utils;

import java.io.Serializable;

import com.redoor.iot.model.Result;

/**
 */
public class ResultUtil implements Serializable{

    /**
	 * 
	 */
	private static final long serialVersionUID = 4620314951636847636L;

	public static Result success(Object object) {
        Result result = new Result();
        result.setCode(0);
        result.setMsg("成功");
        result.setData(object);
        return result;
    }

    public static Result success() {
        return success(null);
    }

    public static Result error(Integer code, String msg) {
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
}
